package com.mentaleye.biz.impl;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mentaleye.bean.AttendanceExceptionBean;
import com.mentaleye.biz.AttendanceExceptionBiz;
import com.mentaleye.dal.model.AttendanceException;
import com.mentaleye.service.AttendanceExceptionService;
import com.mentaleye.util.ObjectUtil;

@Service
public class AttendanceExceptionBizImpl implements AttendanceExceptionBiz {

	private Logger logger = Logger.getLogger(AttendanceExceptionBiz.class);

	@Autowired
	private AttendanceExceptionService dataService;

	@SuppressWarnings("unchecked")
	@Override
	public List<AttendanceExceptionBean> getBeanList() {
		List<AttendanceExceptionBean> beanList = null;
		try {
			List<AttendanceException> dataList = this.dataService.getList();
			beanList = ObjectUtil.transferList(dataList, AttendanceExceptionBean.class);
		} catch (Exception e) {
			logger.error("查询出勤异常信息异常！", e);
		}
		return beanList;
	}

	@Override
	public List<AttendanceException> getList() {
		List<AttendanceException> dataList = null;
		try {
			dataList = this.dataService.getList();
		} catch (Exception e) {
			logger.error("查询出勤异常信息异常！", e);
		}
		return dataList;
	}

}
